package com.qtcm.nas.wzh.commoditys.service.impl;

import com.qtcm.nas.wzh.commoditys.dao.ICommodityDao;
import com.qtcm.nas.wzh.commoditys.pojo.Commodity;
import com.qtcm.nas.wzh.commoditys.pojo.Commoditya;
import com.qtcm.nas.wzh.commoditys.service.ICommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("commodityService")
public class CommodityService implements ICommodityService {
    @Autowired
    @Qualifier("commodityDao")
    private ICommodityDao commodityDao;

    @Override
    public List<Commodity> findAll() {
        System.out.println("查询信息！");
        return commodityDao.findAll();
    }
    @Override
    public int addCommodity(Commodity commodity) {
        System.out.println("增加信息！");
        return commodityDao.addCommodity(commodity);
    }

    @Override
    public int updateCommodity(Commodity commodity) {
        System.out.println("修改信息");
        return commodityDao.updateCommodity(commodity);
    }

    @Override
    public int deleteCommodity(int J_letem_id) {
        System.out.println("删除信息！");
        return commodityDao.deleteCommodity(J_letem_id);
    }

    @Override
    public Commodity findById(int J_letem_id) {
        System.out.println("UID查询信息");
        return commodityDao.findById(J_letem_id);
    }

    @Override
    public void updatestate(Commodity commodity) {
         commodityDao.updatestate(commodity);
    }


    //另外一个
    @Override
    public List<Commoditya> findAlla() {
        return commodityDao.findAlla();
    }



    @Override
    public int addCommoditya(Commoditya commoditya) {
        System.out.println("增加信息a！");
        return commodityDao.addCommoditya(commoditya);
    }

    @Override
    public int updateCommoditya(Commoditya commoditya) {
        System.out.println("修改信息a");
        return commodityDao.updateCommoditya(commoditya);
    }

    @Override
    public int deleteCommoditya(int J_commodity_classification) {
        System.out.println("删除信息a！");
        return commodityDao.deleteCommoditya(J_commodity_classification);
    }

    @Override
    public Commoditya findByIda(int J_commodity_classification) {
        System.out.println("UID查询信息a");
        return commodityDao.findByIda(J_commodity_classification);
    }


}
